package com.neusoft.elmboot.service.Impl;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neusoft.elmboot.mapper.WalletMapper;
import com.neusoft.elmboot.mapper.WalletTransMapper;
import com.neusoft.elmboot.po.WalletTrans;
import com.neusoft.elmboot.service.WalletTransService;
import com.neusoft.elmboot.util.CommonUtil;

@Service
public class WalletTransServiceImpl implements WalletTransService{

    @Autowired
    private WalletTransMapper walletTransMapper;

    @Override
    public int saveTransByPay(WalletTrans wt) {
        wt.setTime(CommonUtil.getCurrentDate());
        return walletTransMapper.saveTransByPay(wt);

    }

    @Override
    public int saveTransByWithdrawal(WalletTrans wt) {
        wt.setTime(CommonUtil.getCurrentDate());
        return walletTransMapper.saveTransByWithdrawal(wt);
    }

    @Override
    public int saveTransByRecharge(WalletTrans wt) {
        wt.setTime(CommonUtil.getCurrentDate());
        return walletTransMapper.saveTransByRecharge(wt);
    }

    @Override
    public List<WalletTrans> listWalletTransByUserId(String userId) {
        return walletTransMapper.listWalletTransByUserId(userId);
    }
}
